-
Notifications
You must be signed in to change notification settings - Fork 0
/
Movie.java
85 lines (66 loc) · 1.86 KB
/
Movie.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package at.htl.MovieManager.model;
import javax.json.bind.annotation.JsonbTransient;
import javax.persistence.*;
import java.util.List;
@Entity
@DiscriminatorColumn
@NamedQueries({
@NamedQuery(name = "Movie.findAll", query = "Select m from Movie m"),
@NamedQuery(name = "Movie.findById", query = "Select m from Movie m where m.id = :id")
})
public class Movie {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String director;
private int release_date;
private int rt_score;
@ManyToMany(cascade = {CascadeType.REFRESH, CascadeType.MERGE},fetch = FetchType.EAGER)
private List<Person> persons;
public Movie() {
}
public Movie(String title, String director, int release_date, int rt_score, List<Person> persons) {
this.title = title;
this.director = director;
this.release_date = release_date;
this.rt_score = rt_score;
this.persons = persons;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public int getRelease_date() {
return release_date;
}
public void setRelease_date(int release_date) {
this.release_date = release_date;
}
public int getRt_score() {
return rt_score;
}
public void setRt_score(int rt_score) {
this.rt_score = rt_score;
}
public List<Person> getPersons() {
return persons;
}
public void setPersons(List<Person> persons) {
this.persons = persons;
}
}